package com.table.dao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class DAOFactory {

	private EntityManagerFactory emf; 

    public DAOFactory() {
        emf = Persistence.createEntityManagerFactory("root");
    }
	
	public EntityManager getEntityManager(){
            return getEmf().createEntityManager();
    }

	public EntityManagerFactory getEmf() {
		return emf;
	}

	public void setEmf(EntityManagerFactory emf) {
		this.emf = emf;
	}
	
}
